package com.ittx.dzt.tiktok.service;

import com.ittx.dzt.edi.dto.PlatformApiParamDTO;
import com.ittx.dzt.sys.response.Result;
import com.ittx.dzt.tiktok.constant.TiktokApiConstant;
import com.ittx.dzt.tiktok.handler.AbstractBaseTiktokApiHandler;
import lombok.extern.slf4j.Slf4j;
import open.constant.PlatformApiConstant;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 是否允许使用全球商品
 * <p>
 * cy.tiktok.seller.permissions.get
 * /seller/202309/permissions （是否允许使用全球商品） https://partner.tiktokshop.com/docv2/page/650a69db4a0bb702c06727ea?external_id=650a69db4a0bb702c06727ea#Back%20To%20Top
 * </p>
 *
 * @author gywang
 * @since 2024-07-26
 */
@Slf4j
@Service
public class TiktokSellerPermissionsGetService extends AbstractBaseTiktokApiHandler<String> {

    @Override
    public String getTiktokMethod() {
        return TiktokApiConstant.SELLER_PERMISSIONS_GET;
    }

    @Override
    public String getLocalApiMethod() {
        return PlatformApiConstant.InboundInterface.TIKTOK_SELLER_PERMISSIONS_GET;
    }

    @Override
    public Result doProcess(PlatformApiParamDTO platformApiParamDTO, String s) {
        Map<String, Object> params = new HashMap<>();
        return this.executeTiktokApi(getDefaultUrl(platformApiParamDTO.getStoreConfig()), platformApiParamDTO.getStoreConfig(), params, null, platformApiParamDTO.getRequestId(), TiktokApiConstant.ApiHttpMethod.GET);
    }
}
